(function() {

this.pasta = this.pasta || {};
this.pasta.webgui = this.pasta.webgui || {};

this.pasta.webgui.Shape = pasta.webgui.Control.extend(
{
	init : function() 
	{
		this._super();
		
		this.mode = 1;
		this.bgColor = null;
		this.borderWeight = 1;
		this.borderColor = "#000000";
		
		this.canvas.style.backgroundColor = undefined;
		this.canvas.style.border = this.borderWeight + "px solid " + this.borderColor;
	},
	
	//------------------ Setter & Getter -----------------
	
	setMode : function(data)
	{
		this.mode = data;
		
		switch (this.mode)
		{
			case 1 : // rectangle
					this.canvas.style.border = this.borderWeight + "px solid " + this.borderColor;
					break;
			case 2 : // top line
					this.canvas.style.border = "";
					this.canvas.style.borderTop = this.borderWeight + "px solid " + this.borderColor;
					break;
			case 3 : // left line
					this.canvas.style.border = "";
					this.canvas.style.borderLeft = this.borderWeight + "px solid " + this.borderColor;
					break;
		}
	},
	
	getBgColor : function()
	{
		return this.bgColor;
	},
	
	setBgColor : function(data)
	{
		this.bgColor = data;
		
		this.canvas.style.background = this.bgColor;
	},
	
	getBorderColor : function()
	{
		return this.borderColor;
	},
	
	setBorderColor : function(data)
	{
		this.borderColor = data;
		
		if ((data == -1) || (data == null))
			this.canvas.style.border = "";
		else
			this.canvas.style.border = this.borderWeight + "px solid " + this.borderColor;
	},
	
	getBorderWeight : function()
	{
		return this.borderWeight;
	},
	
	setBorderWeight : function(data)
	{
		this.borderWeight = data;
		
		this.canvas.style.border = this.borderWeight + "px solid " + this.borderColor;
	}
});

})();